package com.jiulan.hearthearing.ui.home.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiulan.hearthearing.R;
import com.jiulan.hearthearing.ui.menus.MenuModel;

import java.util.List;

public class HomeMenuAdapter extends BaseQuickAdapter<MenuModel, BaseViewHolder> {

    public HomeMenuAdapter(List<MenuModel> data) {
        super(R.layout.item_home_menu, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MenuModel item) {
        helper.setText(R.id.tvActiveName, item.getActiveName());
        ImageView ivActiveIcon = helper.getView(R.id.ivActiveIcon);
        ivActiveIcon.setBackgroundResource(item.getActivePic());
    }
}
